require 'yaml'

module Ann
  # An input neuron is used in the first layer of a neural network to feed the
  # input values into the network.  It should return its most current value as
  # a float from the output method.
  class InputNeuron
    def self.new_layer(values)
      values.collect {|i|
        InputNeuron.new(i)
      }
    end
    
    attr_accessor :value
    
    def initialize(value = nil)
      @value = value
    end
    
    def input
      @value.to_f
    end
    
    def output
      @value.to_f
    end
    
    def adjust(err); end
    def clear; end
    
    def ==(o)
      o.respond_to?(:value) && self.value == o.value
    end
  end
end
